package words

import (
	"context"
	"star/internal/logic/users"
	"star/internal/logic/words"

	"star/api/words/v1"
)

func (c *ControllerV1) SetLeve(ctx context.Context, req *v1.SetLeveReq) (res *v1.SetLeveRes, err error) {
	uid, err := users.GetUid(ctx)
	if err != nil {
		return nil, err
	}
	err = words.SetLevel(ctx, uid, req.Id, int(req.Leve))
	return nil, err
}
